<?php

require_once("/home/wwwbuzzerstar/library/Config.inc.php"); 
require_once("/home/wwwbuzzerstar/library/Connection.inc.php"); 
require_once("/home/wwwbuzzerstar/library/Functions.inc.php");
require_once("/home/wwwbuzzerstar/library/SSDTube.php"); 
require_once("/home/wwwbuzzerstar/library/mobile/Mobile_Detect.php");
require_once("/home/wwwbuzzerstar/library/Texts.inc.php");

class HTML {
	
	public function TrendingPageGenerateContent(){
		
		$ReturnHtmlString	= "";
		$sentences_content	= "";
		$sentences 			= array();
		$PictureHTMLContent = "";
		$BorderContentHTML  ="";
		$AdvertsContentHTML = "";
		
		$monate = array(1=>"Januar",
                2=>"Februar",
                3=>"M&auml;rz",
                4=>"April",
                5=>"Mai",
                6=>"Juni",
                7=>"Juli",
                8=>"August",
                9=>"September",
                10=>"Oktober",
                11=>"November",
                12=>"Dezember");
					
		$func	 			= new Functions();
		$conn 				= new Connection();
		$config 			= new Config();
		
		$categoryHeaderText		=<<<END
			<h1 id="catgSimpleHeader">
			<b>Du befindest dich aktuell in dem Trendin News Bereich - hier findest du die meisst geklickten Artikel auf BuzzerStar.COM:</b>
			<p />
			</h1>
END;
	
		$imageRetArray 		= $func->getScreenResolutionFromUA();
		$x 					= $imageRetArray["xImage"];
		$y 					= $imageRetArray["yImage"];
		$fontsize 			= $imageRetArray["fontsize"];
		$picQuality 		= $imageRetArray["picQuality"];
		
		$table 				= $config->sql_tablename_publish_de();
		$pdo				= $conn->prepareQuery();
		$picpath			= $config->picture_storepath();

		$stmt 				= $pdo->prepare("SELECT * FROM $table WHERE id>0 AND p_isonline=1 AND p_star=1 ORDER BY p_starcount DESC, p_timestamp DESC LIMIT 20");
		$stmt->execute();
		$myRowCount = $stmt->rowCount();
		
		$whileCount = 1; // Warnung: hier muss die Eins so stehen bleiben und darf nicht Null sein
		while($rows = $stmt->fetch(PDO::FETCH_ASSOC)) {
		//echo "whileCount: $whileCount und maxPageCount:$maxPageCount<br>";
		/*	
			if ($whileCount>=$maxPageCount){
				$BorderContentHTML =<<<END
					<div class="kopa-loadmore"><a href="$PageNextButton" class="url" itemprop="url" rel="next"><b>Ich will noch mehr News von $category lesen!</b></a></div>
END;
			};
		*/	
			
			if ($whileCount<4){
				$AdvertsContentHTML =<<<END
					<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
						<ins class="adsbygoogle"
							 style="display:block"
							 data-ad-client="ca-pub-8441004200831936"
							 data-ad-slot="1845200008"
							 data-ad-format="auto"></ins>
					<script>
					(adsbygoogle = window.adsbygoogle || []).push({});
					</script>	
END;
			};
		
			$whileCount++;
			
			$headline			= $rows["p_headline"];
			$article			= $rows["p_articletext"];
			$author				= $rows["p_authorname"];
			$backlink			= $rows["p_backlink"];
			$shortcode			= $rows["p_shortcode"];
			$category_id		= $rows["p_category"];
			$picture_desc		= $rows["p_picture_1_description"];
			
			$linkingcode_twittr	= "https://www.buzzerstar.com/show.php?a=$shortcode";
			$linkingcode		= "https://www.buzzerstar.com/".$func->makeArticleLink($shortcode);
			$list				= explode(". ", $article);
			$result 			= substr($article, 0, 240);
			$sentences 			= preg_split("/[!?.] /", $article, -1, PREG_SPLIT_NO_EMPTY);
		
			for($i=0; $i<=2; $i++){
				if (strlen($sentences[$i])>1){
					$sentences_content	.= $sentences[$i].". ";
				}
			}
  		
			$x = 320;$y = 260;
			$PictureHTMLContent	 = <<<END
				<figure itemtype="http://schema.org/ImageObject"><img class="lazy" src="https://www.buzzerstar.com/images/grey.png" data-original="https://www.buzzerstar.com/i.php?s=$shortcode" width="$x" height="$y" itemprop="image" alt="$picture_desc" title="Coole Bilder: $picture_desc" />
				<figcaption id="figurecaption">$picture_desc</figcaption>
				</figure>
END;
		
			list($pre_date,)	= explode(" ",$rows["p_timestamp"]);
			$monat 				= date("n",strtotime($pre_date));
			$date_month			= $monate[$monat];
			$date_day 			= date("j", strtotime($pre_date));
			$date_year 			= date("Y", strtotime($pre_date));
			
			$keywords_list		= "";
			$keyword_meta		= "";
			$list				= explode(";",$rows["p_tags"]);
			$tagcode = <<<LIST
			<ul>
LIST;
			foreach ($list as $entry23) {
				if (strlen($entry23)>1 && !empty($entry23)){
					$keywords_list 	.= "$entry23 | ";
					$keyword_meta 	.= "$entry23, ";
					$tagcode 		.= <<<LIST
					<li lang="de">$entry23</li>
LIST;
				}//if (strlen($entry23)>1){
			}
			$tagcode.= <<<LIST
			</ul>
LIST;
			
	$ReturnHtmlString .=<<<END
		<div id="main-content" class="mb-20">
			<div class="wrapper">
				<div class="row">	
					<div class="kopa-main-col">
						$categoryHeaderText
                    <div class="widget">
                        <div class="pd-20 kopa-entry-post">
							<article class="entry-item">                            
								<p class="entry-categories style-s"><a href="https://www.buzzerstar.com/kategorie/$category">$category</a></p>
                            <a href="$linkingcode" target="_blank" title="$headline">   
								<h2 class="entry-title"><b><strong>$headline</strong></b></h2>
                                </div>
								$PictureHTMLContent
								<blockquote class="kopa-blockquote style2">
									<p><i>$sentences[0]. $sentences[1].</i></p>
								</a>
								$AdvertsContentHTML
                                </blockquote>							
							 </article>
							</div>
							<div class="kopa-tag-box">
								<span><b>Erzähl es deinen Freunden:</b></span><p />
								(Klick eines der bunten Icons unter diesem Text<br>
								zum teilen mit deinen Freunden auf Facebook,<br> Twitter oder WhatsApp!)
							</div>	
							<div class="kopa-social-links pull-left style4">
								<ul class="clearfix">
									<li><a href="https://www.facebook.com/sharer/sharer.php?u=$linkingcode" title="Diesen Artikel auf Facebook teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Facebook-icon.png" title="In Facebook teilen" itemprop="image" alt="mit Facebook teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://twitter.com/home?status=$linkingcode_twittr" title="Diesen Artikel auf Twitter teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Twitter-icon.png" title="In Twitter teilen" itemprop="image" alt="mit Twitter teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://plus.google.com/share?url=$linkingcode" title="Diesen Artikel auf Google Plus teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Google-Plus-icon.png" title="In Google Plus teilen" itemprop="image" alt="mit Google Plus teilen" width="32" height="32"></figure></a></li>
									<li><a href="WhatsApp://send?text=Coole News: $headline %20-%20 $linkingcode" title="Den Artikel via WhatsApp deinen Freunden schicken" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Whatsapp-icon.png" title="In WhatsApp teilen" itemprop="image" alt="mit WhatsApp teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://pinterest.com/pin/create/button/?url=$linkingcode&media=https://www.buzzerstar.com/i.php?s=$shortcode&description=$headline" title="Auf Pinterest teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Pinterest-icon.png" title="In Pinterest teilen" itemprop="image" alt="mit Pinterest teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://www.stumbleupon.com/submit?url=$linkingcode&title=$headline" title="Deine Freunde auf Stumbleupon informieren" rel="nofollow" target="_blank"><figure><img src="/images/social-new/StumbleUpon-icon.png" title="In Stumbleupon teilen" itemprop="image" alt="mit Stumbleupon teilen" width="32" height="32"></figure></a></li>
									<li><a href="mailto:HierdieEmail@DeinesFreundesEintragen.com?Subject=Schau%20dir%20www.BuzzerStar.com%20an%20-%20lauter%20lustige%20Videos%20und%20coole%20News&Body=Hi,hier ist der Link: $linkingcode . Viel Spaß auf www.BuzzerStar.com!" title="Deinen Freunden eine Email senden" target="_blank"><figure><img src="/images/social-new/email-icon.png" title="Freunde via Email von BuzzerStar erzählen" itemprop="image" alt="Freunde mittels Email mitteilen" width="32" height="32"></figure></a></li>
									<li><a href="https://www.buzzerstar.com/rss.php" title="RSS Feed abonnieren" target="_blank"><figure><img src="/images/social-new/Rss-icon.png" title="RSS laden" itemprop="image" alt="mit Feedly RSS abonnieren" width="32" height="32"></figure></a></li>
								</ul>
							</div>
                            <div class="kopa-tag-box">
								<br /><br />
								<span>Tags dieser News</span>
								$tagcode
								<span class="entry-date"><i class="fa fa-clock-o"></i>&nbsp;$date_day. $date_month $date_year</span>
                            </div>
							<hr id="hrborder">
							$BorderContentHTML
						</div>
                    </div>
                    <!-- widget -->             
                </div>
            <!-- kopa-main-col -->   			
        </div>
        <!-- wrapper -->
    </div>	
END;
		$categoryHeaderText = "";
		$PictureHTMLContent	 = "";
		$AdvertsContentHTML = "";
	} // while($rows = $stmt->fetch(PDO::FETCH_ASSOC)) {
				
	
	// copyright
	$copyYear 			= 2012; 
	$curYear 			= date('Y'); 
	$year 				= $copyYear . (($copyYear != $curYear) ? '-' . $curYear : '');
	$copy 				= "&copy;$year BuzzerStar.com - M.Sc. Sebastian Enger. All Rights Reserved.";

	$ReturnHtmlString .=<<<END
		<!-- main-content -->
		<footer id="kopa-footer">			
			<a href="/post.php" target="_blank">
				<figure itemtype="http://schema.org/ImageObject"><img class="lazy" src="https://www.buzzerstar.com/images/grey.png" data-original="https://www.buzzerstar.com/i.php?s=f8971b2e9" itemprop="image" alt="Coole Artikel auf BuzzerStar schreiben und gratis Guthaben und Gutscheinkarten absahnen" title="Amazon, Zalando, iTunes, Playstore, Value Steam Gutscheine" width="640" height="480" />
					<figcaption><b>Coole Bilder: Bekloppte und Coole News Artikel auf BuzzerStar schreiben und Gutscheinkarten absahnen!</b></figcaption>
				</figure>
				</a>
			<div class="wrapper clearfix">
				<span id="copyright">
					<article id="articletext">		
						<cite>"Hackers - Heroes of the Computer Revolution!"</cite>
						<p />
						$copy
					</article>	
				</span>
			</div>	
			<!-- wrapper -->
		</footer>
		<!-- kopa-footer -->	
END;
	
		if ( $myRowCount >= 1 ){
			$robots = "INDEX,FOLLOW,ALL";
		} else {
			$robots = "NOINDEX,FOLLOW";
		}

		$ReturnContentArray = array("returncontent" =>$ReturnHtmlString, "robots"=>$robots);
		
		return $ReturnContentArray;
	}
	
	public function CategoryPageGenerateContent($page, $CategoryID){
		
		$ReturnHtmlString	= "";
		$sentences_content	= "";
		$sentences 			= array();
		$PictureHTMLContent = "";
		$BorderContentHTML  ="";
		$AdvertsContentHTML = "";
		
		$monate = array(1=>"Januar",
                2=>"Februar",
                3=>"M&auml;rz",
                4=>"April",
                5=>"Mai",
                6=>"Juni",
                7=>"Juli",
                8=>"August",
                9=>"September",
                10=>"Oktober",
                11=>"November",
                12=>"Dezember");
					
		$func	 			= new Functions();
		$conn 				= new Connection();
		$config 			= new Config();
		$texts 				= new Texts();
		
		$catg_array			= $config->array_category();
		$category			= $catg_array[$CategoryID];
		
		$arrayCategoryHeaderText = $texts->categoryTexte();
		$categoryHeaderText1	= $arrayCategoryHeaderText[$CategoryID];
		$categoryHeaderText		=<<<END
			<h1 id="catgSimpleHeader">
			<b>Du befindest dich aktuell in dem News Bereich "$category":</b>
			<p /><p />
			$categoryHeaderText1
			</h1>
END;
	
		if (!is_numeric($page) || !isset($page) || empty($page) || strlen($page) <= 0 ){
			$page = 0;
		}
		$maxPageCount 	= $config->catg_max_results();
		$from 			= ( $maxPageCount * $page );
		if (!is_numeric($from) || !isset($from) || empty($from) || strlen($from) <= 0 ){
			$from = 0;
		}

		$CurrentPage 		= $page;
		$PageNext	 		= $CurrentPage + 1;
		$PageNextButton		= "https://www.buzzerstar.com/kategorie/$category&p=$PageNext";
		
		$imageRetArray 		= $func->getScreenResolutionFromUA();
		$x 					= $imageRetArray["xImage"];
		$y 					= $imageRetArray["yImage"];
		$fontsize 			= $imageRetArray["fontsize"];
		$picQuality 		= $imageRetArray["picQuality"];
		
		$table 				= $config->sql_tablename_publish_de();
		$table_img			= $config->sql_tablename_pictures();
		$shortcode_passkey 	= $config->shortcode_passkey();
		$pdo				= $conn->prepareQuery();
		$picpath			= $config->picture_storepath();

		$stmt 				= $pdo->prepare("SELECT * FROM $table WHERE id>0 AND p_isonline=1 AND p_category=:p_category ORDER BY p_timestamp DESC LIMIT $from, $maxPageCount;");
		$stmt->bindValue(':p_category', $CategoryID, PDO::PARAM_INT);
		$stmt->execute();
		$myRowCount = $stmt->rowCount();
		
		$whileCount = 1; // Warnung: hier muss die Eins so stehen bleiben und darf nicht Null sein
		while($rows = $stmt->fetch(PDO::FETCH_ASSOC)) {
		//echo "whileCount: $whileCount und maxPageCount:$maxPageCount<br>";
			if ($whileCount>=$maxPageCount){
				$BorderContentHTML =<<<END
					<div class="kopa-loadmore"><a href="$PageNextButton" class="url" itemprop="url" rel="next"><b>Ich will noch mehr News von $category lesen!</b></a></div>
END;
			};
			if ($whileCount<4){
				$AdvertsContentHTML =<<<END
					<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
						<ins class="adsbygoogle"
							 style="display:block"
							 data-ad-client="ca-pub-8441004200831936"
							 data-ad-slot="1845200008"
							 data-ad-format="auto"></ins>
					<script>
					(adsbygoogle = window.adsbygoogle || []).push({});
					</script>	
END;
			};
			$whileCount++;
			
			$headline			= $rows["p_headline"];
			$article			= $rows["p_articletext"];
			$author				= $rows["p_authorname"];
			$backlink			= $rows["p_backlink"];
			$shortcode			= $rows["p_shortcode"];
			$category_id		= $rows["p_category"];
			$picture_desc		= $rows["p_picture_1_description"];
			
			$linkingcode_twittr	= "https://www.buzzerstar.com/show.php?a=$shortcode";
			$linkingcode		= "https://www.buzzerstar.com/".$func->makeArticleLink($shortcode);
			$list				= explode(". ", $article);
			$result 			= substr($article, 0, 240);
			$sentences 			= preg_split("/[!?.] /", $article, -1, PREG_SPLIT_NO_EMPTY);
		
			for($i=0; $i<=2; $i++){
				if (strlen($sentences[$i])>1){
					$sentences_content	.= $sentences[$i].". ";
				}
			}
  		
			$x = 320;$y = 260;
			$PictureHTMLContent	 = <<<END
				<figure itemtype="http://schema.org/ImageObject"><img class="lazy" src="https://www.buzzerstar.com/images/grey.png" data-original="https://www.buzzerstar.com/i.php?s=$shortcode" width="$x" height="$y" itemprop="image" alt="$picture_desc" title="Coole Bilder: $picture_desc" />
				<figcaption id="figurecaption">$picture_desc</figcaption>
				</figure>
END;
		
			list($pre_date,)	= explode(" ",$rows["p_timestamp"]);
			$monat 				= date("n",strtotime($pre_date));
			$date_month			= $monate[$monat];
			$date_day 			= date("j", strtotime($pre_date));
			$date_year 			= date("Y", strtotime($pre_date));
			
			$keywords_list		= "";
			$keyword_meta		= "";
			$list				= explode(";",$rows["p_tags"]);
			$tagcode = <<<LIST
			<ul>
LIST;
			foreach ($list as $entry23) {
				if (strlen($entry23)>1 && !empty($entry23)){
					$keywords_list 	.= "$entry23 | ";
					$keyword_meta 	.= "$entry23, ";
					$tagcode 		.= <<<LIST
					<li lang="de">$entry23</li>
LIST;
				}//if (strlen($entry23)>1){
			}
			$tagcode.= <<<LIST
			</ul>
LIST;
			
	$ReturnHtmlString .=<<<END
		<div id="main-content" class="mb-20">
			<div class="wrapper">
				<div class="row">	
					<div class="kopa-main-col">
						$categoryHeaderText
                    <div class="widget">
                        <div class="pd-20 kopa-entry-post">
							<article class="entry-item">                            
								<p class="entry-categories style-s"><a href="https://www.buzzerstar.com/kategorie/$category">$category</a></p>
                            <a href="$linkingcode" target="_blank" title="$headline">   
								<h2 class="entry-title"><b><strong>$headline</strong></b></h2>
                                </div>
								$PictureHTMLContent
								<blockquote class="kopa-blockquote style2">
									<p><i>$sentences[0]. $sentences[1].</i></p>
								</a>
								$AdvertsContentHTML
                                </blockquote>							
							 </article>
							</div>
							<div class="kopa-tag-box">
								<span><b>Erzähl es deinen Freunden:</b></span><p />
								(Klick eines der bunten Icons unter diesem Text<br>
								zum teilen mit deinen Freunden auf Facebook,<br> Twitter oder WhatsApp!)
							</div>	
							<div class="kopa-social-links pull-left style4">
								<ul class="clearfix">
									<li><a href="https://www.facebook.com/sharer/sharer.php?u=$linkingcode" title="Diesen Artikel auf Facebook teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Facebook-icon.png" title="In Facebook teilen" itemprop="image" alt="mit Facebook teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://twitter.com/home?status=$linkingcode_twittr" title="Diesen Artikel auf Twitter teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Twitter-icon.png" title="In Twitter teilen" itemprop="image" alt="mit Twitter teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://plus.google.com/share?url=$linkingcode" title="Diesen Artikel auf Google Plus teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Google-Plus-icon.png" title="In Google Plus teilen" itemprop="image" alt="mit Google Plus teilen" width="32" height="32"></figure></a></li>
									<li><a href="WhatsApp://send?text=Coole News: $headline %20-%20 $linkingcode" title="Den Artikel via WhatsApp deinen Freunden schicken" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Whatsapp-icon.png" title="In WhatsApp teilen" itemprop="image" alt="mit WhatsApp teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://pinterest.com/pin/create/button/?url=$linkingcode&media=https://www.buzzerstar.com/i.php?s=$shortcode&description=$headline" title="Auf Pinterest teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Pinterest-icon.png" title="In Pinterest teilen" itemprop="image" alt="mit Pinterest teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://www.stumbleupon.com/submit?url=$linkingcode&title=$headline" title="Deine Freunde auf Stumbleupon informieren" rel="nofollow" target="_blank"><figure><img src="/images/social-new/StumbleUpon-icon.png" title="In Stumbleupon teilen" itemprop="image" alt="mit Stumbleupon teilen" width="32" height="32"></figure></a></li>
									<li><a href="mailto:HierdieEmail@DeinesFreundesEintragen.com?Subject=Schau%20dir%20www.BuzzerStar.com%20an%20-%20lauter%20lustige%20Videos%20und%20coole%20News&Body=Hi,hier ist der Link: $linkingcode . Viel Spaß auf www.BuzzerStar.com!" title="Deinen Freunden eine Email senden" target="_blank"><figure><img src="/images/social-new/email-icon.png" title="Freunde via Email von BuzzerStar erzählen" itemprop="image" alt="Freunde mittels Email mitteilen" width="32" height="32"></figure></a></li>
									<li><a href="https://www.buzzerstar.com/rss.php" title="RSS Feed abonnieren" target="_blank"><figure><img src="/images/social-new/Rss-icon.png" title="RSS laden" itemprop="image" alt="mit Feedly RSS abonnieren" width="32" height="32"></figure></a></li>
								</ul>
							</div>
                            <div class="kopa-tag-box">
								<br /><br />
								<span>Tags dieser News</span>
								$tagcode
								<span class="entry-date"><i class="fa fa-clock-o"></i>&nbsp;$date_day. $date_month $date_year</span>
                            </div>
							<hr id="hrborder">
							$BorderContentHTML
						</div>
                    </div>
                    <!-- widget -->             
                </div>
            <!-- kopa-main-col -->   			
        </div>
        <!-- wrapper -->
    </div>	
END;
		$categoryHeaderText = "";
		$PictureHTMLContent	 = "";
		$AdvertsContentHTML = "";
	} // while($rows = $stmt->fetch(PDO::FETCH_ASSOC)) {
				
	
	// copyright
	$copyYear 			= 2012; 
	$curYear 			= date('Y'); 
	$year 				= $copyYear . (($copyYear != $curYear) ? '-' . $curYear : '');
	$copy 				= "&copy;$year BuzzerStar.com - M.Sc. Sebastian Enger. All Rights Reserved.";

	$ReturnHtmlString .=<<<END
		<!-- main-content -->
		<footer id="kopa-footer">			
			<a href="/post.php" target="_blank">
				<figure itemtype="http://schema.org/ImageObject"><img class="lazy" src="https://www.buzzerstar.com/images/grey.png" data-original="https://www.buzzerstar.com/i.php?s=f8971b2e9" itemprop="image" alt="Coole Artikel auf BuzzerStar schreiben und gratis Guthaben und Gutscheinkarten absahnen" title="Amazon, Zalando, iTunes, Playstore, Value Steam Gutscheine" width="640" height="480" />
					<figcaption><b>Coole Bilder: Bekloppte und Coole News Artikel auf BuzzerStar schreiben und Gutscheinkarten absahnen!</b></figcaption>
				</figure>
				</a>
			<div class="wrapper clearfix">
				<span id="copyright">
					<article id="articletext">		
						<cite>"Hackers - Heroes of the Computer Revolution!"</cite>
						<p />
						$copy
					</article>	
				</span>
			</div>	
			<!-- wrapper -->
		</footer>
		<!-- kopa-footer -->	
END;
	
		if ( $myRowCount >= 1 ){
			$robots = "INDEX,FOLLOW,ALL";
		} else {
			$robots = "NOINDEX,FOLLOW";
		}

		$ReturnContentArray = array("keywords"=>"$keyword_meta, $category, news, neuigkeiten, bild, heftig, cool","returncontent" =>$ReturnHtmlString, "category" => $category, "robots"=>$robots);
		
		return $ReturnContentArray;
	}
	
	public function WitzeGenerateContent(){
		
		$func	 			= new Functions();
		$conn 				= new Connection();
		$config 			= new Config();
	//	$detect 			= new Mobile_Detect;
	//	$deviceTypeMobile 	= $detect->isMobile();
			
		$imageRetArray 		= $func->getScreenResolutionFromUA();
		$x 					= $imageRetArray["xImage"];
		$y 					= $imageRetArray["yImage"];
		$fontsize 			= $imageRetArray["fontsize"];
		$picQuality 		= $imageRetArray["picQuality"];
		$shortcode			= "3314dab93";
				
		// related content
		//$RelatedMoreContent = $func->GetNewRelatedContent("Mahjong | games | entertainment | spass");
		
		// copyright
		$copyYear 			= 2012; 
		$curYear 			= date('Y'); 
		$year 				= $copyYear . (($copyYear != $curYear) ? '-' . $curYear : '');
		$copy 				= "&copy;$year BuzzerStar.com - M.Sc. Sebastian Enger. All Rights Reserved.";
		
		$linkingcode_twittr	= "https://www.buzzerstar.com/witze/";
		$linkingcode		= "https://www.buzzerstar.com/witze/";
		$headline			= "Die geilsten Witze auf www.BuzzerStar.com!";
		
		$tagcode 		.= <<<LIST
				<li lang="de">Witze</li>
				<li lang="en">LOL</li>
				<li lang="de">Funny</li>
				<li lang="de">Humor</li>
				<li lang="de">Spaß</li>
				<li lang="de">lustige Texte</li>
				<li lang="de">Witz</li>
LIST;

		$table 				= $config->sql_tablename_witze_de();
		$witz_maxcount		= $config->witze_max_entry();
		$pdo				= $conn->prepareQuery();
		$stmt 				= $pdo->prepare("SELECT * FROM $table WHERE 1=1 ORDER BY RAND() LIMIT $witz_maxcount;");
		$stmt->execute();
		
		//$witze_text			= array();
		//$witze_catg			= array();
		$witze_content		=<<<END
			<ul>	
END;
		
		$row_count 			= 0;
		while($rows = $stmt->fetch(PDO::FETCH_ASSOC)) {
			$p_catg	= $rows["p_catg"];
			$p_text	= $rows["p_text"];
			$p_catg	= preg_replace('/[[:^print:]]/', '', $p_catg);
			$p_text	= preg_replace('/[[:^print:]]/', '', $p_text);
			
			//array_push($witze_catg, $rows["p_catg"]);
			//array_push($witze_text, $rows["p_text"]);
			
			$witze_content		.=<<<END
				<li>
					<strong>$p_catg Witze</strong> <br />
					<em>$p_text</em>
					<br />
				</li>
				<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
END;

			if ($row_count>=$witz_maxcount){
				break 1;
			}
			$row_count++;
		}

		$witze_content		.=<<<END
			</ul>	
END;

		$ReturnHtmlStringSudoku .=<<<END
		<div id="main-content" class="mb-20">
			<div class="wrapper">
				<div class="row">	
					<div class="kopa-main-col">
                    <div class="widget">
                        <div class="pd-20 kopa-entry-post">
                            <article class="entry-item">
                                <span class="entry-categories style-s"><a href="https://www.buzzerstar.com/witze/">Witze</a></span>
                                <h1 class="entry-title"><b><strong>Lustiges, Humorvolles und Funny Texte - Blondinen, Funny, Arzt, Tier, Ostfriesen, Computer, Beamten, Kinder, Banker, Ossis, Kneipen Witze!</strong></b></h1>
                                </div>
                               <blockquote class="kopa-blockquote style2">
									$witze_content
									<a href="javascript:location.reload(true)">
										<button>Ich will noch mehr Witze</button>
									</a>
									<br /><br />
									<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
										<ins class="adsbygoogle"
											 style="display:block"
											 data-ad-client="ca-pub-8441004200831936"
											 data-ad-slot="1845200008"
											 data-ad-format="auto"></ins>
									<script>
									(adsbygoogle = window.adsbygoogle || []).push({});
									</script>	
									
								</blockquote>
								<blockquote class="kopa-blockquote style2">
									<div style="line-height: 16px; font-size: 14px;">
										<h3>
											Lustige Texte sind gut zum Lachen und sollen dich erheitern. Witze haben eine lange Geschichte hinter sich und werden von Generation zu Generation übergeben. Es gibt Menschen, die können Tage lang Witze erzählen und somit andere Leute zum schmunzeln bringen. Wer mehr lacht und mehr Spaß am Leben hat, wird älter und hat ein längeres Leben. Wenn ihr Raucher sein solltet, könnt ihr das somit gut ausgleichen. Jeden Tag mit einem Lachen starten, so macht das Arbeiten mehr Spaß und euch gelingen die Dinge des Lebens einfacher. Wir zeigen euch auch ab und an Lustige Videos mit Situtationen, wo du einfach nur OMG LOL sagen kannst. Funny Stuff bis zum Abwinken - auf BuzzerStar.
										</h3>
									</div>	
								</blockquote>
							 </article>
							</div>
							<div class="kopa-tag-box">
								<span><b>Erzähl es deinen Freunden:</b></span>
							</div>	
							<div class="kopa-social-links pull-left style4">
								<ul class="clearfix">
									<li><a href="https://www.facebook.com/sharer/sharer.php?u=$linkingcode" title="Diesen Artikel auf Facebook teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Facebook-icon.png" title="In Facebook teilen" itemprop="image" alt="mit Facebook teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://twitter.com/home?status=$linkingcode_twittr" title="Diesen Artikel auf Twitter teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Twitter-icon.png" title="In Twitter teilen" itemprop="image" alt="mit Twitter teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://plus.google.com/share?url=$linkingcode" title="Diesen Artikel auf Google Plus teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Google-Plus-icon.png" title="In Google Plus teilen" itemprop="image" alt="mit Google Plus teilen" width="32" height="32"></figure></a></li>
									<li><a href="WhatsApp://send?text=Coole News: $headline %20-%20 $linkingcode" title="Den Artikel via WhatsApp deinen Freunden schicken" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Whatsapp-icon.png" title="In WhatsApp teilen" itemprop="image" alt="mit WhatsApp teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://pinterest.com/pin/create/button/?url=$linkingcode&media=https://www.buzzerstar.com/i.php?s=$shortcode&description=$headline" title="Auf Pinterest teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Pinterest-icon.png" title="In Pinterest teilen" itemprop="image" alt="mit Pinterest teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://www.stumbleupon.com/submit?url=$linkingcode&title=$headline" title="Deine Freunde auf Stumbleupon informieren" rel="nofollow" target="_blank"><figure><img src="/images/social-new/StumbleUpon-icon.png" title="In Stumbleupon teilen" itemprop="image" alt="mit Stumbleupon teilen" width="32" height="32"></figure></a></li>
									<li><a href="mailto:HierdieEmail@DeinesFreundesEintragen.com?Subject=Schau%20dir%20www.BuzzerStar.com%20an%20-%20lauter%20lustige%20Videos%20und%20coole%20News&Body=Hi,hier ist der Link: $linkingcode . Viel Spaß auf www.BuzzerStar.com!" title="Deinen Freunden eine Email senden" target="_blank"><figure><img src="/images/social-new/email-icon.png" title="Freunde via Email von BuzzerStar erzählen" itemprop="image" alt="Freunde mittels Email mitteilen" width="32" height="32"></figure></a></li>
									<li><a href="https://www.buzzerstar.com/rss.php" title="RSS Feed abonnieren" target="_blank"><figure><img src="/images/social-new/Rss-icon.png" title="RSS laden" itemprop="image" alt="mit Feedly RSS abonnieren" width="32" height="32"></figure></a></li>
								</ul>
							</div>
                            <div class="kopa-tag-box">
								<br />
								<span>Tags dieser News</span>
								$tagcode
                            </div>
						</div>
                    </div>
					<!-- 
					 <div class="widget kopa-article-list-widget article-list-23">
                        <h3 class="widget-title style3"> Noch mehr <span>coole Artikel</span></h3>
                        <div class="pd-20">
							<ul class="clearfix">
								$RelatedMoreContent
							</ul>
                        </div>
                    </div>
					-->
                    <!-- widget -->             
                </div>
                <!-- kopa-main-col -->        
        </div>
        <!-- wrapper -->

    </div>
    <!-- main-content -->
	<footer id="kopa-footer">
        <div class="wrapper clearfix">
			<span id="copyright">
				<article id="articletext">		
					<cite>"Hackers - Heroes of the Computer Revolution!"</cite>
					<p />
					$copy
				</article>	
			</span>
		</div>	
        <!-- wrapper -->
    </footer>
    <!-- kopa-footer -->		
END;

		return $ReturnHtmlStringSudoku;
	}
	
	public function MahjongGenerateContent(){
		
		$func	 			= new Functions();
		$conn 				= new Connection();
		$config 			= new Config();
		$detect 			= new Mobile_Detect;
		$deviceTypeMobile 	= $detect->isMobile();
		
		$hint_mobile		= "";
		if ($deviceTypeMobile === TRUE){
			$hint_mobile		= "Du kannst dein Smartphone auch quer halten, um besser zu spielen und mehr vom Spiel zu sehen.";
		}
		
		$imageRetArray 		= $func->getScreenResolutionFromUA();
		$x 					= $imageRetArray["xImage"];
		$y 					= $imageRetArray["yImage"];
		$fontsize 			= $imageRetArray["fontsize"];
		$picQuality 		= $imageRetArray["picQuality"];
		$shortcode			= "3314dab93";
				
		// related content
		//$RelatedMoreContent = $func->GetNewRelatedContent("Mahjong | games | entertainment | spass");
		
		// copyright
		$copyYear 			= 2012; 
		$curYear 			= date('Y'); 
		$year 				= $copyYear . (($copyYear != $curYear) ? '-' . $curYear : '');
		$copy 				= "&copy;$year BuzzerStar.com - M.Sc. Sebastian Enger. All Rights Reserved.";
		
		$linkingcode_twittr	= "https://www.buzzerstar.com/spiele/mahjong/";
		$linkingcode		= "https://www.buzzerstar.com/spiele/mahjong/";
		$headline			= "Mahjong kostenlos: Es ist Zeit Mahjong Solitär zu spielen!";
		
		$tagcode 		.= <<<LIST
				<li lang="de">Mahjong</li>
				<li lang="en">Mahjong solitaire</li>
				<li lang="de">Mahjong Solitär</li>
				<li lang="de">Mahjong spielen</li>
				<li lang="de">Mahjong kostenlos</li>
				<li lang="de">Mah jong</li>
				<li lang="de">Mah Jongg</li>
LIST;

		$ReturnHtmlStringSudoku .=<<<END
		<div id="main-content" class="mb-20">
			<div class="wrapper">
				<div class="row">	
					<div class="kopa-main-col">
                    <div class="widget">
                        <div class="pd-20 kopa-entry-post">
                            <article class="entry-item">
                                <span class="entry-categories style-s"><a href="https://www.buzzerstar.com/spiele/mahjong/">Mahjong</a></span>
                                <h1 class="entry-title"><b><strong>Kostenlos Mahjong spielen</strong></b></h1>
                                </div>
                               <blockquote class="kopa-blockquote style2"></blockquote>
<div id="wrap">
	<ul xid="toolbar"><!-- TOOLBAR -->
        <li id="game-name">Mahjong Solitär</li>
        <li id="pairs">0 Paare sind noch offen</li>
		Vergangene Spielzeit: <li id="game-time">00:00:00</li> 
		<li>$hint_mobile</li>
		<li>
            <input type="button" id="restart" class="button left" value="Neues Spiel"><input type="button" id="shuffle" class="button right" value="Shuffle">
        </li>
        <!--
		<li>
            <input type="button" id="undo" class="button" value="Undo">
			<input type="button" id="options-button" class="button" value="Options">
        </li>
		-->
		<li>
			<div id="game-wrap">
				<canvas id="canvas"></canvas>
			</div>
		</li>
    </ul><!-- END TOOLBAR -->
</div>

<!-- MODAL WINDOW -->
<!--
<div class="hide" id="overlay"></div>
<div id="modal" class="modal hide">
    <div id="modal-msg"></div>
    <a href="#" class="modal-button" id="close-modal">Close</a>
</div>
-->
<!-- OPTIONS -->
<script id="options" type="text/tmpl">
<h1>Wähle eine Karte zum Spielen aus</h1>
<ul id="maps">
    <li><img data-map="space" src="/images/space.png"></li>
    <li><img data-map="heart" src="/images/heart.png"></li>
    <li><img data-map="default" src="/images/default.png"></li>
    <li><img data-map="pyramid" src="/images/pyramid.png"></li>
</ul>
<label> Style:
<select id="tile-style" value="/images/flowers.png">
    <option value="/images/symbols.png">Symbole</options>
    <option value="/images/letters.png">Holz</option>
    <option value="/images/flowers.png">Blumen</options>    
</select>
</script>
<!-- CONGRATULATIONS -->
<script id="congrat" type="text/tmpl">
<h1>Congratulations</h1>
<h2>You solved it in</h2>
<h3>{time}</h3>
</script>

<!-- GAMEOVER -->
<script id="gameover" type="text/tmpl">
<h1>GAME OVER</h1>
<h2>what do you want to do?</h2>
<button class="modal-button shuffle">Shuffle</button>
<button class="modal-button restart">Play again</button>
<p class="clear"><small>Shuffling tiles adds a 60-second penalty to your time</small></p>
</script>
								<p />
								<blockquote class="kopa-blockquote style2">									
								
								<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
										<ins class="adsbygoogle"
											 style="display:block"
											 data-ad-client="ca-pub-8441004200831936"
											 data-ad-slot="1845200008"
											 data-ad-format="auto"></ins>
									<script>
									(adsbygoogle = window.adsbygoogle || []).push({});
									</script>	
								
								</blockquote>
								<div style="line-height: 16px; font-size: 14px;">
									<h3><strong>Gratis MahJong kostenlos Spielen</strong></h3><br />							
									Mah Jongg ist ein altes chinesische Brettspiel und wird heute sehr oft MahJong oder Mahjongg genannt. Das Spielziel ist es alle Steine des Spieles paarweise anzuordnen und abzubauen. <br /><br />
									Die Steine legen gestabelt in verschiedenen Reihen nebeneinander, in der Mitte sind viele Felder in übereinander gestabelten Reihen überlagert. Pro Spielzug kann man zwei Spielsteine oder Spielblöcke auswählen und mit einem gleichen Motiv kombinieren, sodass diese dann anschließend vom Spielfeld verschwinden. Man kann einen Spielstein aber nur dann wählen, wenn dieser frei am rechten oder linken Rand einer Reihe liegt. Spiel MahJong hat gewonnen, wer alle Steine nacheinander abgebaut hat. Das klingt wirklich einfach, ist jedoch sehr komplex von der Spielmechanik her. In jeder Runde werden die Steine neu gemischt, sodass man clever planen und strategisch spielen muss.<br /><br />
									Das Mahjong Onlinespiel auf BuzzerStar ist kostenlos und erfordert keine Registrierung - man kann es auf einem Smartphone oder auf dem PC oder Mac spielen. Die Software passt sich automatisch deinem Bildschirm an - MahJong auf BuzzerStar ist reponsive programmiert. Unser Gratis MahJong wird dich für Stunden an den Bildschirm deines Telefon oder Pc fesseln. <br />
								</div>	
							 </article>
							</div>
							<div class="kopa-tag-box">
								<span><b>Erzähl es deinen Freunden:</b></span>
							</div>	
							<div class="kopa-social-links pull-left style4">
								<ul class="clearfix">
									<li><a href="https://www.facebook.com/sharer/sharer.php?u=$linkingcode" title="Diesen Artikel auf Facebook teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Facebook-icon.png" title="In Facebook teilen" itemprop="image" alt="mit Facebook teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://twitter.com/home?status=$linkingcode_twittr" title="Diesen Artikel auf Twitter teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Twitter-icon.png" title="In Twitter teilen" itemprop="image" alt="mit Twitter teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://plus.google.com/share?url=$linkingcode" title="Diesen Artikel auf Google Plus teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Google-Plus-icon.png" title="In Google Plus teilen" itemprop="image" alt="mit Google Plus teilen" width="32" height="32"></figure></a></li>
									<li><a href="WhatsApp://send?text=Coole News: $headline %20-%20 $linkingcode" title="Den Artikel via WhatsApp deinen Freunden schicken" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Whatsapp-icon.png" title="In WhatsApp teilen" itemprop="image" alt="mit WhatsApp teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://pinterest.com/pin/create/button/?url=$linkingcode&media=https://www.buzzerstar.com/i.php?s=$shortcode&description=$headline" title="Auf Pinterest teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Pinterest-icon.png" title="In Pinterest teilen" itemprop="image" alt="mit Pinterest teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://www.stumbleupon.com/submit?url=$linkingcode&title=$headline" title="Deine Freunde auf Stumbleupon informieren" rel="nofollow" target="_blank"><figure><img src="/images/social-new/StumbleUpon-icon.png" title="In Stumbleupon teilen" itemprop="image" alt="mit Stumbleupon teilen" width="32" height="32"></figure></a></li>
									<li><a href="mailto:HierdieEmail@DeinesFreundesEintragen.com?Subject=Schau%20dir%20www.BuzzerStar.com%20an%20-%20lauter%20lustige%20Videos%20und%20coole%20News&Body=Hi,hier ist der Link: $linkingcode . Viel Spaß auf www.BuzzerStar.com!" title="Deinen Freunden eine Email senden" target="_blank"><figure><img src="/images/social-new/email-icon.png" title="Freunde via Email von BuzzerStar erzählen" itemprop="image" alt="Freunde mittels Email mitteilen" width="32" height="32"></figure></a></li>
									<li><a href="https://www.buzzerstar.com/rss.php" title="RSS Feed abonnieren" target="_blank"><figure><img src="/images/social-new/Rss-icon.png" title="RSS laden" itemprop="image" alt="mit Feedly RSS abonnieren" width="32" height="32"></figure></a></li>
								</ul>
							</div>
                            <div class="kopa-tag-box">
								<br />
								<span>Tags dieser News</span>
								$tagcode
                            </div>
						</div>
                    </div>
					<!-- 
					 <div class="widget kopa-article-list-widget article-list-23">
                        <h3 class="widget-title style3"> Noch mehr <span>coole Artikel</span></h3>
                        <div class="pd-20">
							<ul class="clearfix">
								$RelatedMoreContent
							</ul>
                        </div>
                    </div>
					-->
                    <!-- widget -->             
                </div>
                <!-- kopa-main-col -->        
        </div>
        <!-- wrapper -->

    </div>
    <!-- main-content -->
	<footer id="kopa-footer">
        <div class="wrapper clearfix">
			<span id="copyright">
				<article id="articletext">		
					<cite>"Hackers - Heroes of the Computer Revolution!"</cite>
					<p />
					$copy
				</article>	
			</span>
		</div>	
        <!-- wrapper -->
    </footer>
    <!-- kopa-footer -->		
END;

		return $ReturnHtmlStringSudoku;
	}
	
	public function SudokuGenerateContent(){
		
		$func	 			= new Functions();
		$conn 				= new Connection();
		$config 			= new Config();
		$detect 			= new Mobile_Detect;
		$deviceTypeMobile 	= $detect->isMobile();
		
		$hint_mobile		= "";
		if ($deviceTypeMobile === TRUE){
			$hint_mobile		= "Du kannst dein Smartphone auch quer halten, um besser zu spielen und mehr vom Spiel zu sehen.";
		}
		
		$imageRetArray 		= $func->getScreenResolutionFromUA();
		$x 					= $imageRetArray["xImage"];
		$y 					= $imageRetArray["yImage"];
		$fontsize 			= $imageRetArray["fontsize"];
		$picQuality 		= $imageRetArray["picQuality"];
		
		$shortcode			= "3314dab93";
		
		// related content
		//$RelatedMoreContent = $func->GetNewRelatedContent("soduku | games | entertainment | spass");

		// copyright
		$copyYear 			= 2012; 
		$curYear 			= date('Y'); 
		$year 				= $copyYear . (($copyYear != $curYear) ? '-' . $curYear : '');
		$copy 				= "&copy;$year BuzzerStar.com - M.Sc. Sebastian Enger. All Rights Reserved.";
		
		$linkingcode_twittr	= "https://www.buzzerstar.com/spiele/sudoku/";
		$linkingcode		= "https://www.buzzerstar.com/spiele/sudoku/";
		$headline			= "Sudoku kostenlos: Es ist Zeit Soduku zu spielen!";
		
		$tagcode 		.= <<<LIST
				<li lang="de">Sudoku</li>
				<li lang="de">Sodoko</li>
				<li lang="de">Soduko</li>
				<li lang="de">Sudoku spielen</li>
				<li lang="de">Sudoku Zeit.de</li>
LIST;

		$ReturnHtmlStringSudoku .=<<<END
		<div id="main-content" class="mb-20">
			<div class="wrapper">
				<div class="row">	
					<div class="kopa-main-col">
                    <div class="widget">
                        <div class="pd-20 kopa-entry-post">
                            <article class="entry-item">
                                <span class="entry-categories style-s"><a href="https://www.buzzerstar.com/spiele/sudoku/">Sudoku</a></span>
                                <h1 class="entry-title"><b><strong>Kostenlos Sudoku spielen</strong></b></h1>
                                </div>
								<blockquote class="kopa-blockquote style2">
									<b><input type="button" value=" Neues Spiel " onClick="window.location.reload()"></b><br />
									<b>$hint_mobile</b>
								</blockquote>
								<div id="sudoku_container"></div>
								<p />
								<blockquote class="kopa-blockquote style2">									
									<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
									<!-- BuzzerStar.com Detail Page -->
									<ins class="adsbygoogle"
										 style="display:block"
										 data-ad-client="ca-pub-8441004200831936"
										data-ad-slot="1845200008"
										 data-ad-format="auto"></ins>
									<script>
									(adsbygoogle = window.adsbygoogle || []).push({});
									</script>
								</blockquote>
								<div style="line-height: 16px; font-size: 14px;">
									<h3><strong>Gratis Sudoku kostenlos Spielen</strong></h3><br />			
									Im Jahr 1970 wurde Sudoku das erste mal veröffentlicht: in New York vom dem R&auml;tselexperten Dell in seinem Online- und Print-Magazin "Mathematische R&auml;tsel und logische Probleme" pr&auml;sentiert. <br />
									Im 1984, genauer gesagt im April, hat der Zeitschriftenpublisher Nikoli in Japan das R&auml;tsel in  Wochenzeitschrift "Monthly Nikolist" seinen interessierten Lesern vorgestellt. Damals noch unter dem Namen Kaji Maki - wie der Nikoli-Pr&auml;sident. Später nannte es man dann Sudoku. "Su" hei&szlig;t "Nummer" und "doku" lautet "einzeln". Im Jahr 1986 wurde das Puzzel Sodoku dann in seiner heutigen Form veröffentlicht. Die Firma Nikoli hat immer noch das Warenzeichen f&uuml;r den Namen Sudoku im Patentamt für sich registriert.<br /><br />
									Kurze Zeit später nahm sich ein Computerexperte dem Thema an und entwickelte einen Softwarealgorithmus, mit dem man mittels Computern lösbare Sudoku Rätzsel erstellen kann. Es gibt aktuell 10 hoch 50 verschiedene Varianten eines Sudoku auf der ganzen Welt. Bloss warum ist es so beliebt und wird in Indien, Irland, D&auml;nemark, Australien, Kanada, Israel und Deutschland so gerne gespielt? Es ist die Befriedigung, die sich einstellt, wenn man nach ca. 15 Minuten ein Sudoku Spiel geschafft und erfolgreich gelöst hat. <br /><br />
									Das Sudoku Onlinespiel auf BuzzerStar ist kostenlos und erfordert keine Registrierung - man kann es auf einem Smartphone oder auf dem PC oder Mac spielen. Die Software passt sich automatisch deinem Bildschirm an - Sudoku auf BuzzerStar ist reponsive programmiert. Unser Gratis Sudoku wird dich für Stunden an den Bildschirm deines Telefon oder Pc fesseln. <br />
								</div>
							 </article>
							</div>
							<div class="kopa-tag-box">
								<span><b>Erzähl es deinen Freunden:</b></span>
							</div>	
							<div class="kopa-social-links pull-left style4">
								<ul class="clearfix">
									<li><a href="https://www.facebook.com/sharer/sharer.php?u=$linkingcode" title="Diesen Artikel auf Facebook teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Facebook-icon.png" title="In Facebook teilen" itemprop="image" alt="mit Facebook teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://twitter.com/home?status=$linkingcode_twittr" title="Diesen Artikel auf Twitter teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Twitter-icon.png" title="In Twitter teilen" itemprop="image" alt="mit Twitter teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://plus.google.com/share?url=$linkingcode" title="Diesen Artikel auf Google Plus teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Google-Plus-icon.png" title="In Google Plus teilen" itemprop="image" alt="mit Google Plus teilen" width="32" height="32"></figure></a></li>
									<li><a href="WhatsApp://send?text=Coole News: $headline %20-%20 $linkingcode" title="Den Artikel via WhatsApp deinen Freunden schicken" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Whatsapp-icon.png" title="In WhatsApp teilen" itemprop="image" alt="mit WhatsApp teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://pinterest.com/pin/create/button/?url=$linkingcode&media=https://www.buzzerstar.com/i.php?s=$shortcode&description=$headline" title="Auf Pinterest teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Pinterest-icon.png" title="In Pinterest teilen" itemprop="image" alt="mit Pinterest teilen" width="32" height="32"></figure></a></li>
									<li><a href="https://www.stumbleupon.com/submit?url=$linkingcode&title=$headline" title="Deine Freunde auf Stumbleupon informieren" rel="nofollow" target="_blank"><figure><img src="/images/social-new/StumbleUpon-icon.png" title="In Stumbleupon teilen" itemprop="image" alt="mit Stumbleupon teilen" width="32" height="32"></figure></a></li>
									<li><a href="mailto:HierdieEmail@DeinesFreundesEintragen.com?Subject=Schau%20dir%20www.BuzzerStar.com%20an%20-%20lauter%20lustige%20Videos%20und%20coole%20News&Body=Hi,hier ist der Link: $linkingcode . Viel Spaß auf www.BuzzerStar.com!" title="Deinen Freunden eine Email senden" target="_blank"><figure><img src="/images/social-new/email-icon.png" title="Freunde via Email von BuzzerStar erzählen" itemprop="image" alt="Freunde mittels Email mitteilen" width="32" height="32"></figure></a></li>
									<li><a href="https://www.buzzerstar.com/rss.php" title="RSS Feed abonnieren" target="_blank"><figure><img src="/images/social-new/Rss-icon.png" title="RSS laden" itemprop="image" alt="mit Feedly RSS abonnieren" width="32" height="32"></figure></a></li>
								</ul>
							</div>
                            <div class="kopa-tag-box">
								<br />
								<span>Tags dieser News</span>
								$tagcode
                            </div>
						</div>
                    </div>
					<!-- 
					 <div class="widget kopa-article-list-widget article-list-23">
                        <h3 class="widget-title style3"> Noch mehr <span>coole Artikel</span></h3>
                        <div class="pd-20">
							<ul class="clearfix">
								$RelatedMoreContent
							</ul>
                        </div>
                    </div>
					-->
                    <!-- widget -->             
                </div>
                <!-- kopa-main-col -->        
        </div>
        <!-- wrapper -->

    </div>
    <!-- main-content -->
	<footer id="kopa-footer">
        <div class="wrapper clearfix">
			<span id="copyright">
				<article id="articletext">		
					<cite>"Hackers - Heroes of the Computer Revolution!"</cite>
					<p />
					$copy
				</article>	
			</span>
		</div>	
        <!-- wrapper -->
    </footer>
    <!-- kopa-footer -->		
END;

		return $ReturnHtmlStringSudoku;
	}
	
	public function DetailpageGenerateContent($shortcode){
		
		$ReturnHtmlString	= "";
		$sliderHTMLContent	= "";
		$sentences_content	= "";
				
		$func	 			= new Functions();
		$conn 				= new Connection();
		$config 			= new Config();
		$SSDTube 			= new SSDTube();
		
		$linkingcode_twittr	= "https://www.buzzerstar.com/show.php?a=$shortcode";
		$linkingcode		= "https://www.buzzerstar.com/".$func->makeArticleLink($shortcode);
		$imageRetArray 		= $func->getScreenResolutionFromUA();
		$x 					= $imageRetArray["xImage"];
		$y 					= $imageRetArray["yImage"];
		$fontsize 			= $imageRetArray["fontsize"];
		$picQuality 		= $imageRetArray["picQuality"];
		
		$table 				= $config->sql_tablename_publish_de();
		$table_img			= $config->sql_tablename_pictures();
		$shortcode_passkey 	= $config->shortcode_passkey();
		$pdo				= $conn->prepareQuery();
		$picpath			= $config->picture_storepath();

		$stmt 				= $pdo->prepare("SELECT * FROM $table WHERE p_shortcode=:shortcode LIMIT 1");
		$stmt->bindValue(':shortcode', $shortcode, PDO::PARAM_STR);
		$stmt->execute();
		$rows 				= $stmt->fetchAll(PDO::FETCH_ASSOC);
			
		// video:
		$video_youtube_uri 	= $rows[0]["p_videolink"];
		$SSDTube->identify($video_youtube_uri);
		$EmbeddedVideo 		= $SSDTube->embed;
		$tumbnailVideoImg	= $SSDTube->thumbnail;
		$VideoAuthor		= $SSDTube->author;
		$video_duration		= $func->getDuration();
		$video_title		= $SSDTube->title;
		$video_description	= $SSDTube->description;
		$video_width		= $SSDTube->width;
		$video_height		= $SSDTube->height;
		$video_youtube_embed	= $SSDTube->youtube_embed;
		$youtube_watch		= $SSDTube->youtube_watch;
		$tmp_http_yt_video 	= $func->ogTagsYoutubeVideo($video_youtube_uri);
		
		// category
		$category_id		= $rows[0]["p_category"];
		$catg_array			= $config->array_category();
		$category			= $catg_array[$category_id];

		$headline			= $rows[0]["p_headline"];
		$article			= $rows[0]["p_articletext"];
		$picture_desc		= $rows[0]["p_picture_1_description"];
		$headline_social	= $headline;
		$sentences 			= preg_split("/[!?.] /", $article, -1, PREG_SPLIT_NO_EMPTY);
		
		$sliderHTMLContent =<<<ENDD
			<div class="kopa-social-links pull-left style4">
				<ul class="clearfix">
					<li><a href="https://www.facebook.com/sharer/sharer.php?u=$linkingcode" title="Diesen Artikel auf Facebook teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Facebook-icon.png" title="In Facebook teilen" itemprop="image" alt="mit Facebook teilen" width="32" height="32"></figure></a></li>
					<li><a href="https://twitter.com/home?status=$linkingcode_twittr" title="Diesen Artikel auf Twitter teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Twitter-icon.png" title="In Twitter teilen" itemprop="image" alt="mit Twitter teilen" width="32" height="32"></figure></a></li>
					<li><a href="https://plus.google.com/share?url=$linkingcode" title="Diesen Artikel auf Google Plus teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Google-Plus-icon.png" title="In Google Plus teilen" itemprop="image" alt="mit Google Plus teilen" width="32" height="32"></figure></a></li>
					<li><a href="WhatsApp://send?text=Coole News: $headline_social %20-%20 $linkingcode" title="Den Artikel via WhatsApp deinen Freunden schicken" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Whatsapp-icon.png" title="In WhatsApp teilen" itemprop="image" alt="mit WhatsApp teilen" width="32" height="32"></figure></a></li>
					<li><a href="https://pinterest.com/pin/create/button/?url=$linkingcode&media=https://www.buzzerstar.com/i.php?s=$shortcode&description=$headline_social" title="Auf Pinterest teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Pinterest-icon.png" title="In Pinterest teilen" itemprop="image" alt="mit Pinterest teilen" width="32" height="32"></figure></a></li>
					<li><a href="https://www.stumbleupon.com/submit?url=$linkingcode&title=$headline_social" title="Deine Freunde auf Stumbleupon informieren" rel="nofollow" target="_blank"><figure><img src="/images/social-new/StumbleUpon-icon.png" title="In Stumbleupon teilen" itemprop="image" alt="mit Stumbleupon teilen" width="32" height="32"></figure></a></li>
					<li><a href="mailto:HierdieEmail@DeinesFreundesEintragen.com?Subject=Schau%20dir%20www.BuzzerStar.com%20an%20-%20lauter%20lustige%20Videos%20und%20coole%20News&Body=Hi,hier ist der Link: $linkingcode . Viel Spaß auf www.BuzzerStar.com!" title="Deinen Freunden eine Email senden" target="_blank"><figure><img src="/images/social-new/email-icon.png" title="Freunde via Email von BuzzerStar erzählen" itemprop="image" alt="Freunde mittels Email mitteilen" width="32" height="32"></figure></a></li>
					<li><a href="https://www.buzzerstar.com/rss.php" title="RSS Feed abonnieren" target="_blank"><figure><img src="/images/social-new/Rss-icon.png" title="RSS laden" itemprop="image" alt="mit Feedly RSS abonnieren" width="32" height="32"></figure></a></li>
				</ul>
			</div>
ENDD;
							
		for($i=2; $i<=count($sentences); $i++){
			if (strlen($sentences[$i])>1){
				$sentences_content	.= $sentences[$i].". ";
			}
		}
   
		$monate = array(1=>"Januar",
                2=>"Februar",
                3=>"M&auml;rz",
                4=>"April",
                5=>"Mai",
                6=>"Juni",
                7=>"Juli",
                8=>"August",
                9=>"September",
                10=>"Oktober",
                11=>"November",
                12=>"Dezember");
		
		list($pre_date,)	= explode(" ",$rows[0]["p_timestamp"]);
		$monat 				= date("n",strtotime($pre_date));
		$date_month			= $monate[$monat];
		$date_day 			= date("j", strtotime($pre_date));
		$date_year 			= date("Y", strtotime($pre_date));
		
		$keywords_list		= "";
		$keyword_meta		= "";
		$list				= explode(";",$rows[0]["p_tags"]);
		$tagcode = <<<LIST
		<ul>
LIST;
		foreach ($list as $entry23) {
			if (strlen($entry23)>1 && !empty($entry23)){
				$keywords_list 	.= "$entry23 | ";
				$keyword_meta 	.= "$entry23, ";
				$tagcode 		.= <<<LIST
				<li lang="de">$entry23</li>
LIST;
			}//if (strlen($entry23)>1){
		}
		$tagcode.= <<<LIST
		</ul>
LIST;

		// related content
		$RelatedMoreContent = $func->GetNewRelatedContent($keywords_list." | ".$headline);

		// copyright
		$copyYear 			= 2012; 
		$curYear 			= date('Y'); 
		$year 				= $copyYear . (($copyYear != $curYear) ? '-' . $curYear : '');
		$copy 				= "&copy;$year BuzzerStar.com - M.Sc. Sebastian Enger. All Rights Reserved.";
		
		/// Hier den Slider aufbauen: Start:
		$slidercontent		= $rows[0]["p_slidercontent"];
		$sliderExplode		= explode(";", $slidercontent);
		array_push($sliderExplode,$shortcode);
				
		$sliderHTMLContent	 .= <<<END
			<div class="entry-thumb">
				<div class="owl-carousel owl-carousel-7">			
END;
	
		for ($i=0;$i<=count($sliderExplode);$i++){	
			if (array_key_exists($i,$sliderExplode) && strlen($sliderExplode[$i]) > 4){	
				$pdo23				= $conn->prepareQuery();	
				$stmt23 			= $pdo23->prepare("SELECT p_title FROM $table_img WHERE p_shortcode=:shortcode LIMIT 1;");
				$stmt23->bindValue(':shortcode', $sliderExplode[$i], PDO::PARAM_STR);
				$stmt23->execute();
				$rows23 			= $stmt23->fetchAll(PDO::FETCH_ASSOC);
				$p_imagedesc		= $rows23[0]["p_title"];
				$img_desc			= $rows23[0]["p_title"];
				if ( stripos($p_imagedesc, "http") !== false ){
					$img_desc = $func->autolink($p_imagedesc, array("target"=>"_blank"));
				} else {
					$img_desc = $p_imagedesc;
				}
					//
				$sliderHTMLContent	 .= <<<END
					<div class="item">
						<figure itemtype="http://schema.org/ImageObject"><img class="lazy" src="https://www.buzzerstar.com/images/grey.png" data-original="https://www.buzzerstar.com/i.php?s=$sliderExplode[$i]" itemprop="image" alt="$img_desc" title="$img_desc" />
						<figcaption id="figurecaption">$picture_desc</figcaption>
						</figure>
					</div>	
END;
			} // if (array_key_exists($i,$sliderExplode)){	
		} // for ($i=0;$i<=count($sliderExplode);$i++){	

			$sliderHTMLContent	 .= <<<END
					</div>
						</div> 	
END;

		/// Hier den Slider aufbauen: ENDE		
		$ReturnHtmlString .=<<<END
		<div id="main-content" class="mb-20">
			<div class="wrapper">
				<div class="row">	
					<div class="kopa-main-col">
                    <div class="widget">
                        <div class="pd-20 kopa-entry-post">
                            <article class="entry-item">
                                <p class="entry-categories style-s"><a href="https://www.buzzerstar.com/kategorie/$category">$category</a></p>
                                <h1 class="entry-title"><b><strong>$headline</strong></b></h1>
                                </div>
								<blockquote class="kopa-blockquote style2">
                                    <p><i>$sentences[0]. $sentences[1].</i></p>
									
									<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
										<ins class="adsbygoogle"
											 style="display:block"
											 data-ad-client="ca-pub-8441004200831936"
											 data-ad-slot="1845200008"
											 data-ad-format="auto"></ins>
									<script>
									(adsbygoogle = window.adsbygoogle || []).push({});
									</script>												
                                </blockquote>
								<div itemprop="video" itemscope itemtype="http://schema.org/VideoObject">
									$EmbeddedVideo
									<h2><span itemprop="name">$video_title</span></h2>
									<meta itemprop="duration" content="$video_duration" />
									<meta itemprop="thumbnailURL" content="$tumbnailVideoImg" />
									<meta itemprop="contentURL" content="$youtube_watch" />						
									<meta itemprop="embedURL" content="$video_youtube_embed" />
									<span itemprop="description">$video_description</span>
									<meta itemprop="height" content="$video_height" />
									<meta itemprop="width" content="$video_width" />
									<p />
								</div>
								<blockquote class="kopa-blockquote style2">
                                    <p><i>$sentences_content.</i></p>
                                </blockquote>
								
								<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
								<!-- BuzzerStar.com Detail Page -->
								<ins class="adsbygoogle"
									 style="display:block"
									 data-ad-client="ca-pub-8441004200831936"
									data-ad-slot="1845200008"
									 data-ad-format="auto"></ins>
								<script>
								(adsbygoogle = window.adsbygoogle || []).push({});
								</script>
								
								$sliderHTMLContent
							 </article>
							</div>
							<div class="kopa-tag-box">
								<span><b>Erzähl es deinen Freunden:</b></span><p />
								(Klick eines der bunten Icons unter diesem Text<br>
								zum teilen mit deinen Freunden auf Facebook,<br> Twitter oder WhatsApp!)
							</div>	
							
							$SocialLinksContent
							
                            <div class="kopa-tag-box">
								<br /><br />
								<span>Tags dieser News</span>
								$tagcode
								<span class="entry-date"><i class="fa fa-clock-o"></i>&nbsp;$date_day. $date_month $date_year</span>
                            </div>
						</div>
                    </div>
					 <div class="widget kopa-article-list-widget article-list-23">
                        <h3 class="widget-title style3"> Noch mehr <span>coole Artikel</span></h3>
                        <div class="pd-20">
							<ul class="clearfix">
								$RelatedMoreContent
							</ul>
                        </div>
                    </div>
                    <!-- widget -->             
                </div>
            <!-- kopa-main-col -->   			
        </div>
        <!-- wrapper -->
    </div>
    <!-- main-content -->
	<footer id="kopa-footer">
		<a href="/post.php" target="_blank">
			<figure itemtype="http://schema.org/ImageObject"><img class="lazy" src="https://www.buzzerstar.com/images/grey.png" data-original="https://www.buzzerstar.com/i.php?s=f8971b2e9" itemprop="image" alt="Coole Artikel auf BuzzerStar schreiben und gratis Guthaben und Gutscheinkarten absahnen" title="Amazon, Zalando, iTunes, Playstore, Value Steam Gutscheine" width="640" height="480" />
				<figcaption><b>Coole Bilder: Bekloppte und Coole News Artikel auf BuzzerStar schreiben und Gutscheinkarten absahnen!</b></figcaption>
			</figure>
			</a>
		<div class="wrapper clearfix">
			<span id="copyright">
				<article id="articletext">		
					<cite>"Hackers - Heroes of the Computer Revolution!"</cite>
					<p />
					$copy
				</article>	
			</span>
		</div>	
        <!-- wrapper -->
    </footer>
    <!-- kopa-footer -->		
END;
				
		$ReturnContentArray = array("keywords"=>"$keyword_meta, $category, news, neuigkeiten, bild, heftig, cool","articletext"=>$article, "headline"=>$headline, "returncontent" =>$ReturnHtmlString, "video_yt_beautify_ssl" => $tmp_http_yt_video, "category" => $category, "headline" =>$headline);
		
		
		return $ReturnContentArray;
	}
	
	public function StartpageGenerateNews($page){
		
		$PageNext	 		= $page + 1;
		
		$ReturnHtmlString	= "";
		
		$conn 				= new Connection();
		$config 			= new Config();
		$func	 			= new Functions();
		
		$pdo				= $conn->prepareQuery();
		$table 				= $config->sql_tablename_publish_de();
		$table_img			= $config->sql_tablename_pictures();
		$shortcode_passkey 	= $config->shortcode_passkey();
		$pdo				= $conn->prepareQuery();
		$picpath			= $config->picture_storepath();
		$maxPageCount 		= $config->index_max_results();
		
		$imageRetArray 		= $func->getScreenResolutionFromUA();
		$x 					= $imageRetArray["xImage"];
		$y 					= $imageRetArray["yImage"];
		$fontsize 			= $imageRetArray["fontsize"];
		$picQuality 		= $imageRetArray["picQuality"];
		
		$page 				= $func->stripHtml($_REQUEST['p']);
		
		if (!is_numeric($page) || !isset($page) || empty($page) || strlen($page) <= 0 ){
			$page = 0;
		}
		
		$monate = array(1=>"Januar",
                2=>"Februar",
                3=>"M&auml;rz",
                4=>"April",
                5=>"Mai",
                6=>"Juni",
                7=>"Juli",
                8=>"August",
                9=>"September",
                10=>"Oktober",
                11=>"November",
                12=>"Dezember");
		
		$from 			= ( $maxPageCount * $page );
		$stmt 			= $pdo->prepare("SELECT * FROM $table WHERE id>0 AND p_isonline=1 ORDER BY p_timestamp DESC LIMIT $from, $maxPageCount;");
		$stmt->execute();
		
		$ReturnHtmlString .=<<<END
			<div id="main-content" class="mb-20">
        <div class="wrapper">

            <div xclass="widget-area-18">
                <div xclass="widget kopa-ads-1-widget">
					<!-- google adwords kommt hier ein -->
                </div>
                <!-- widget --> 
            </div>
            <!-- widget-area-18 -->

            <div class="row">
                <div class="widget-area-28 kopa-col-1">
                    <!-- widget --> 
					<div class="widget kopa-masonry-6-widget">
						<h3 class="widget-title style3"><span>Die coolsten News auf BuzzerStar</span></h3>
							<ul class="kopa-masonry-wrap">
END;
		
		$row_count 		= 0;
		$all_row_count 	= 0;
		while($rows = $stmt->fetch(PDO::FETCH_ASSOC)) {
			
			$row_count++;
			$all_row_count++;
			
			$shortcode			= "";
			$headline			= $rows["p_headline"];
			$timestamp			= $rows["p_timestamp"];
			$article			= $rows["p_articletext"];
			$author				= $rows["p_authorname"];
			$backlink			= $rows["p_sourcelink"];
			$shortcode			= $rows["p_shortcode"];
			$category_id		= $rows["p_category"];
			$pic_descr			= $rows["p_picture_1_description"];
			$catg_array			= $config->array_category();
			$category			= $catg_array[$category_id];
			$categoryLink		= $func->buildCategoryLink($category_id);
			$linkingcode		= "https://www.buzzerstar.com/".$func->makeArticleLink($shortcode);
			$linkingcode_twittr	= "https://www.buzzerstar.com/show.php?a=$shortcode";
			$list 				= preg_split("/[!?.]/", $article, -1, PREG_SPLIT_NO_EMPTY);
		
			list($pre_date,)	= explode(" ",$timestamp);
			$monat 				= date("n",strtotime($pre_date));
			$date_month			= $monate[$monat];
			$date_day 			= date("j", strtotime($pre_date));
			$date_year 			= date("Y", strtotime($pre_date));

			$sentences 			= array();
			$sentences 			= preg_split("/[!?.] /", $article, -1, PREG_SPLIT_NO_EMPTY);
/*
			$imageFiller	=<<<FIN
				<figure itemtype="http://schema.org/ImageObject"><img src="https://www.buzzerstar.com/i.php?s=$shortcode" width="$x" height="$y" itemprop="image" alt="$pic_descr" title="$pic_descr" lazyload /><figurecaption id="figcaptStart"><strong>$pic_descr</strong></figurecaption></figure>
FIN;
*/		
		//width="380" height="200"
		//	if ($all_row_count >0){
				$imageFiller	=<<<FIN
					<figure itemtype="http://schema.org/ImageObject"><img class="lazy" src="https://www.buzzerstar.com/images/grey.png" data-original="https://www.buzzerstar.com/i.php?s=$shortcode" width="$x" height="$y" itemprop="image" alt="$pic_descr" title="$pic_descr" /><figurecaption id="figcaptStart"><strong>$pic_descr</strong></figurecaption></figure>
FIN;
		//	}
					
			$ReturnHtmlString .=<<<END
                            <li class="ms-item6" >
                                <article class="entry-item">
                                    <div class="pd-20">
                                        <div class="entry-thumb style1">
											<h5><a href="$categoryLink">$category</a></h5>
                                        </div>
										<div class="entry-content">
                                           <summary><h3 class="entry-title"><a itemprop="description" href="$linkingcode" title="$pic_descr: $headline">$headline</a></h3></summary>
                                           <a href="$linkingcode">$imageFiller</a>
										   <div class="entry-meta">
                                                <a>
                                                    <div class="entry-author">
                                                        <span>M.Sc. Sebastian Enger</span>
                                                    </div>
                                                </a>
												&nbsp;|&nbsp;
                                                <span class="entry-date"><i class="fa fa-clock-o"> $date_day. $date_month $date_year</i></span>
                                            </div>
                                            <p>$sentences[0]. $sentences[1].<p /> 
										</div>
                                    </div>
                                    <footer class="entry-footer">
                                        <div class="kopa-social-links pull-left style4">
                                            <ul class="clearfix">
												<li><a href="https://www.facebook.com/sharer/sharer.php?u=$linkingcode" title="Diesen Artikel auf Facebook teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Facebook-icon.png" title="In Facebook teilen" itemprop="image" alt="mit Facebook teilen" width="32" height="32"></figure></a></li>
												<li><a href="https://twitter.com/home?status=$linkingcode_twittr" title="Diesen Artikel auf Twitter teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Twitter-icon.png" title="In Twitter teilen" itemprop="image" alt="mit Twitter teilen" width="32" height="32"></figure></a></li>
												<li><a href="https://plus.google.com/share?url=$linkingcode" title="Diesen Artikel auf Google Plus teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Google-Plus-icon.png" title="In Google Plus teilen" itemprop="image" alt="mit Google Plus teilen" width="32" height="32"></figure></a></li>
												<li><a href="WhatsApp://send?text=Coole News: $headline %20-%20 $linkingcode" title="Den Artikel via WhatsApp deinen Freunden schicken" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Whatsapp-icon.png" title="In WhatsApp teilen" itemprop="image" alt="mit WhatsApp teilen" width="32" height="32"></figure></a></li>
												<li><a href="https://pinterest.com/pin/create/button/?url=$linkingcode&media=https://www.buzzerstar.com/i.php?s=$shortcode&description=$headline" title="Auf Pinterest teilen" class="fa" rel="nofollow" target="_blank"><figure><img src="/images/social-new/Pinterest-icon.png" title="In Pinterest teilen" itemprop="image" alt="mit Pinterest teilen" width="32" height="32"></figure></a></li>
												<li><a href="https://www.stumbleupon.com/submit?url=$linkingcode&title=$headline" title="Deine Freunde auf Stumbleupon informieren" rel="nofollow" target="_blank"><figure><img src="/images/social-new/StumbleUpon-icon.png" title="In Stumbleupon teilen" itemprop="image" alt="mit Stumbleupon teilen" width="32" height="32"></figure></a></li>
												<li><a href="mailto:HierdieEmail@DeinesFreundesEintragen.com?Subject=Schau%20dir%20www.BuzzerStar.com%20an%20-%20lauter%20lustige%20Videos%20und%20coole%20News&Body=Hi,hier ist der Link: $linkingcode . Viel Spaß auf www.BuzzerStar.com!" title="Deinen Freunden eine Email senden" target="_blank"><figure><img src="/images/social-new/email-icon.png" title="Freunde via Email von BuzzerStar erzählen" itemprop="image" alt="Freunde mittels Email mitteilen" width="32" height="32"></figure></a></li>
												<li><a href="https://www.buzzerstar.com/rss.php" title="RSS Feed abonnieren" target="_blank"><figure><img src="/images/social-new/Rss-icon.png" title="RSS laden" itemprop="image" alt="mit Feedly RSS abonnieren" width="32" height="32"></figure></a></li>
											</ul>
										</div>
                                    </footer>       
                                </article>
								<div class="clear"></div>
                            </li>
END;
		
			/*Anweisung muss vor Hautpanweisung $ReturnHtmlString .=<<<END stehen */
			if ( $row_count > 1){
				$ReturnHtmlString .=<<<END
					</ul>
						</div>
						<div class="widget kopa-masonry-6-widget">
							<ul class="kopa-masonry-wrap">
END;
			}
						
			if ( $row_count > 1){
				$row_count 	= 0;
			}
						
		} // while($rows = $stmt->fetch(PDO::FETCH_ASSOC)) {
		
		$copyYear 			= 2012; 
		$curYear 			= date('Y'); 
		$year 				= $copyYear . (($copyYear != $curYear) ? '-' . $curYear : '');
		$copy 				= "&copy;$year BuzzerStar.com - M.Sc. Sebastian Enger. All Rights Reserved.";
		
		$ReturnHtmlString .=<<<END
			</ul>
			<div class="kopa-loadmore"><a href="https://www.buzzerstar.com/?p=$PageNext" class="url" itemprop="url" rel="next"><b>Ich will noch mehr News lesen!</b></a></div>
						
					</div>
				</div>
				<a href="/post.php" target="_blank">
					<figure itemtype="http://schema.org/ImageObject"><img class="lazy" src="https://www.buzzerstar.com/images/grey.png" data-original="https://www.buzzerstar.com/i.php?s=f8971b2e9" itemprop="image" alt="Coole Artikel auf BuzzerStar schreiben und gratis Guthaben und Gutscheinkarten absahnen" title="Amazon, Zalando, iTunes, Playstore, Value Steam Gutscheine" />
						<figcaption><strong>Coole Bilder: Gleich News und Artikel auf BuzzerStar.com schreiben, Gutscheinkarten für Amazon, Valve Steam, Playstation Plus Card, Zalando oder Apple iTunes absahnen!</strong></figcaption>
					</figure>
				</a>
				</div>
               <!-- widget-area-29 -->
            </div>
            <!-- row --> 
        </div>
        <!-- wrapper -->
    </div>
	
	 <footer id="kopa-footer">
        <div class="wrapper clearfix">
			<p id="copyright">
				<article id="articletext">
					Die News werden t&auml;glich von Benutzern verfasst, die auf BuzzerStar surfen und als Autor t&auml;tig werden wollen. Schreib einen Artikel zu einem Thema deiner Wahl, wird dieser freigeschaltet, bekommst du einen <b>SEO follow-Backlink</b> und kannst mittels deines Paypal Spenden Buttons dich, von den BuzzerStar Besuchern, für deine Arbeit bezahlen lassen.
					Anschliessend kannst du deinen geschriebenen Buzzer Star Artikel im Internet teilen und auf Facebook und Twitter posten. Die Webseite www.buzzerstar.com wurde gegr&uuml;ndet um dem Internet eine Publisher Plattform zu geben, bei der Benutzer aus aller Welt, egal welcher Sprache, Inhalte kostenlos verteilen k&ouml;nnen. Wir bieten einen klaren Mehrwert zu den vorhandenen Angeboten im Netz, dort kann man passive konsumieren, aber nicht aktiv mitgestalten. Hier bei Buzzer Star gehen wir einen anderen Weg. Inhalte sind da um geschrieben, gelesen, geteilt und verlinkt zu werden. All diese Angebote beinhalten diese Internetseite. Wir haben uns bem&uuml;ht die Webseite mit <strong>Responsive Design</strong> für Desktop, Tablets und Smartphones startklar zu gestalten. Egal ob du ein <em>Blackberry, Android Telefon, ein iPhone oder iPad benutzt</em>, egal ob <em>Apple Mac, Windows PC, Unix und Linux</em> mit jedem (mobilen) Betriebssystem kannst du die Webseiten auf BuzzerStar besuchen. Die Seiten sind <strong>HTML5 und CSS3</strong> optimiert, die Bilder reagieren responsive, d.h. <em>auf einem Mobiltelefon werden die Bilder vor der Auslieferung verkleinert ausgeliefert</em>. Der Desktop Rechner hingegen bekommt <b>die volle (Full HD) Aufl&ouml;sung</b> bei <strong>Bildern und Videos</strong>. Die Bewegtbilder oder Videos werden bei Youtube gehostet, wir arbeiten an einer Unterst&uuml;tzung für weitere Videohoster. Somit kannst du in deinem Artikel gerne auch <strong>Werbung für deinen Youtube Kanal machen</strong> und deine <b>Youtube Videos</b> einbinden, solange sie zu dem Inhalt deiner <i>Neuigkeiten</i> passen. Mit BuzzerStar kannst du innerhalb von 5 Minuten eine News ins Netz stellen. Wir haben beim verfassen der Newsinhalte die Webseite Buzzerstar so programmiert, dass dein Artikel alle 25 Sekunden zwischen gespeichert wird. Sollte dein Browser in dieser Zeit abst&uuml;rzen, kannst du mit einem einfachen Klick deinen geschrieben Artikel einfach wieder laden und weiter bearbeiten. Dieses Feature wurde umgesetzt, nachdem das <b>Blogsystem Wordpress</b> intensiv studiert wurde. Dort gibt es die Post Revisions und daran orientieren wir uns ebenfalls. Das Backend von BuzzerStar basiert auf einer Kombination von <strong>Perl (die Module, ua. Mobile Detect in Perl gibts auf den <b>CPAN</b> Webseiten), jQuery / Ajax und Javascript, PHP + XCache, Mysql PDO, sowie dem Open Source Sphinx Indexer und Ubuntu</strong>. Auf der Open Source Plattform Sourceforge und Google Code haben wir weitere Programme und Tools hinterlegt, die wir während der Entwicklung
					von BuzzerStar kreiert haben. Ihr könnt sie kostenfrei herunterladen, die Lizenzen entsprechen dem GNU Lesser General Public License. Diese Tools zusammen garantieren kurze Zugriffszeiten, realisieren <b>Responsive Images bzw. Adaptive Images</b> und Webdesign. 
					<br /><br />
					<cite>"Hackers - Heroes of the Computer Revolution!"</cite>
					<br /><br />
					$copy
				</article>	
			</p>
		</div>	
        <!-- wrapper -->
    </footer>
    <!-- kopa-footer -->
END;
	
		$stmt 				= null; // doing this is mandatory for connection to get closed
		$pdo 				= null;

		return $ReturnHtmlString;
		
	} // public function StartpageGenerateNews($page){
		
	
	public function StartpageGenerateHeader($show_headline){
		
		$func	 			= new Functions();
		$config 			= new Config();
		$LinkableCatgID 	= $config->category_to_show();
		$category_content	= "";
		$category_content_mobile = "";
		$headline_content	= "";
		
		if ($show_headline==1){
			$headline_content .=<<<END
					<h1 id="white">Humorvolles, Witziges, Verrücktes und kostenlose Spiele aus aller Welt. Teile es mit deinen Freunden!</h1>
END;
		}
		
		$category_content_mobile .=<<<END
<li><a href="https://www.buzzerstar.com/trending/" title="Navigiere zur BuzzerStar Kategorie Trending News" class="url" itemprop="url"><span itemprop="title">Beliebtesten News</span></a></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
END;

$category_content .=<<<END
<li><a href="https://www.buzzerstar.com/trending/" title="Navigiere zur BuzzerStar Kategorie News Trends" class="url" itemprop="url"><span itemprop="title">Beliebtesten News</span></a></li>
END;

		foreach ($LinkableCatgID as $keyCatg ){
			$linkableCodeCatg 	= $func->buildCategoryLink($keyCatg);
			$catgName 			= $func->categoryIDtoName($keyCatg);
			
			$category_content_mobile .=<<<END
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="$linkableCodeCatg" title="Navigiere zur BuzzerStar Kategorie $catgName" class="url" itemprop="url"><span itemprop="title">$catgName</span></a></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
END;

$category_content .=<<<END
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="$linkableCodeCatg" title="Navigiere zur BuzzerStar Kategorie $catgName" class="url" itemprop="url"><span itemprop="title">$catgName</span></a></li>
END;
}
	$mystring = <<<EOT
		<header class="kopa-header">
        <!-- kopa-header-middle -->
        <div class="kopa-header-bottom">
            <div class="wrapper">
                <div class="header-bottom-wrap">
					<div class="kopa-logo">
						<a href="/" title="BuzzerStar.COM Startseite"><figure itemtype="http://schema.org/ImageObject"><img src="/images/logo_startpage.png" itemprop="image" alt="BuzzerStar Charakter" title="BuzzerStar Logo"></figure></a>
					</div>
					$headline_content
                    <nav class="kopa-main-nav" itemprop="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList">
                        <meta itemprop="name" content="Breadcrumb"/>
						<meta itemprop="description" content="Brotkrumennavigation für BuzzerStar.COM"/>
						
						<ul class="main-menu sf-menu" itemprop="itemListElement">
                            <li class="current-menu-item" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
                                <a href="https://www.buzzerstar.com/" itemprop="url"><span itemprop="title">Startseite</span></a>
                            </li>
                            <li>
                                <a>Spiele, Fun & Witze</a>
                                <ul class="sub-menu" itemprop="itemListElement">
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.com/witze/" itemprop="url" target="_self" title="Witze auf BuzzerStar"><span itemprop="title">Witze</span></a></li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.com/spiele/mahjong/" itemprop="url" target="_self" title="Gratis Mahjong auf BuzzerStar spielen"><span itemprop="title">Mahjong</span></a></li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.com/spiele/sudoku/" itemprop="url" target="_self" title="Spiele Sudoku kostenlos auf BuzzerStar"><span itemprop="title">Sudoku</span></a></li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.net/" itemprop="url" target="_blank" title="BuzzerStar.NET - Viral News"><img src="/images/en.png" alt="BuzzerStar in English" title="Latest Buzz on the Net" />
									- BuzzerStar.NET</a></li>
                                </ul>
                            </li>
							<li>
                                <a>News</a>
                                <ul class="sub-menu" itemprop="itemListElement">
                                    $category_content
                                </ul>
                            </li>
                            <li>
                                <a>Information</a>
                                <ul class="sub-menu" itemprop="itemListElement">
                                    <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.com/post.php" itemprop="url" target="_blank"><span itemprop="title">Selbst News schreiben</span></a></li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.com/rss.php" itemprop="url" target="_blank"><span itemprop="title">RSS Feed</span></a></li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.com/newsticker/" itemprop="url" target="_blank"><span itemprop="title">NewsTicker</span></a></li>
                                    <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.com/imprint.php" itemprop="url" rel="nofollow" target="_blank"><span itemprop="title">Impressum</span></a></li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.com/privacy-policy.php" itemprop="url" rel="nofollow" target="_blank"><span itemprop="title">Datenschutz</span></a></li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.com/development/" itemprop="url" target="_blank"><span itemprop="title">Perl & CPan Software</span></a></li>
                                </ul>
                            </li>
							<li>
								<a>Suche</a>
                                <ul class="sub-menu">
                                    <li> 
										<form class="search-form clearfix">
											<input type="reset" id="reset" value="Löschen" /><p />
											<span class="fa fa-search"><input type="text" class="searchclass search-text search" id="searchid" placeholder="Suchbegriff eingeben: " /></span>
											<div id="result"></div>
										</form>
									</li>
                                </ul>
                            </li>
                        </ul>                
                    </nav>
                    <!--/end main-nav-->

                    <nav class="main-nav-mobile" itemprop="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList">
                        <meta itemprop="name" content="Breadcrumb"/>
						<meta itemprop="description" content="Brotkrumennavigation für das mobile BuzzerStar.COM"/>
						
						<a class="pull">Menu<i class="fa fa-caret-down"></i></a>
                        <ul class="main-menu-mobile" itemprop="itemListElement">
							<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
							<li class="current-menu-item" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
                                <a href="https://www.buzzerstar.com/" itemprop="url"><span itemprop="title">Startseite</span></a>
                            </li>
                            <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
							<li>
                                <a>Spiele, Fun & Witze</a>
                                <ul class="sub-menu" itemprop="itemListElement">
                                    <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.com/witze/" itemprop="url" target="_self" title="Witze auf BuzzerStar"><span itemprop="title">Witze</span></a></li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.com/spiele/mahjong/" itemprop="url" target="_self" title="Gratis Mahjong auf BuzzerStar spielen"><span itemprop="title">Mahjong</span></a></li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.com/spiele/sudoku/" itemprop="url" target="_self" title="Spiele Sudoku kostenlos auf BuzzerStar"><span itemprop="title">Sudoku</span></a></li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.net/" itemprop="url" target="_blank" title="BuzzerStar.NET - Viral News"><img src="/images/en.png" alt="BuzzerStar in English" title="Latest Buzz on the Net" />
									- BuzzerStar.NET</a></li>
                                </ul>
                            </li>
							<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
							<li>
                                <a>Kategorien</a>
                                <ul class="sub-menu" itemprop="itemListElement">
                                    $category_content_mobile
                                </ul>
                            </li>
							<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
							<li>
                                <a>Information</a>
                                <ul class="sub-menu" itemprop="itemListElement">
                                    <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.com/post.php" itemprop="url" rel="nofollow" target="_blank"><span itemprop="title">News posten</span></a></li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.com/rss.php" itemprop="url" target="_blank"><span itemprop="title">RSS Feed</span></a></li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.com/newsticker/" itemprop="url" target="_blank"><span itemprop="title">NewsTicker</span></a></li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
                                    <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.com/imprint.php" itemprop="url" rel="nofollow" target="_blank"><span itemprop="title">Impressum</span></a></li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
									<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.buzzerstar.com/privacy-policy.php" itemprop="url" rel="nofollow" target="_blank"><span itemprop="title">Datenschutz</span></a></li>
                                </ul>
                            </li>
							<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
							<li>
                                <a>Suche</a>
                                <ul class="sub-menu">
                                    <li> 
										<form class="search-form clearfix">
											<input type="reset" id="reset" value="Löschen" /><p />
											<input type="text" class="searchclass search-text search" id="searchid" placeholder="Suchbegriff eingeben: " />
											<div id="result"></div>
										</form>
									</li>
                                </ul>
                            </li>
                        </ul>                
                    </nav>
                    <!--/end main-nav-->
					<!-- search-form -->
                    <!--search-box-->
                </div>
                <!-- header-bottom-wrap -->
				        <!-- search-form -->
                    </div>
                    <!--search-box-->
                </div>
                <!-- header-bottom-wrap -->
            </div>
            <!-- wrapper -->
        </div>
        <!-- kopa-header-bottom -->
    </header>
    <!-- kopa-page-header -->
EOT;
		return $mystring;
	}
}
?>